var PEditor = {
	cudrager : null,
	orx : 0, ox : 0,
	ory : 0, oy : 0,
	clearpx : function (stro){
		str=""+stro+"";
		return (str.replace("px",""))*1;
	},
	follow : function (e){
		var obj = PEditor.cudrager;
		try{
			obj.style.top = parseInt(e.clientY-(PEditor.clearpx(obj.style.height)/2))+"px";
			obj.style.left = parseInt(e.clientX-(PEditor.clearpx(obj.style.width)/2))+"px";
			status=obj.style.left+" , "+obj.style.top;
		}catch(ex){
			eventh.del(document,"mousemove",PEditor.follow);
		}
	},
	order : function(e){
		if (e.keyCode==43){
			PEditor.cudrager.style.zIndex++;
		}else if (e.keyCode==45){
			PEditor.cudrager.style.zIndex--;
		}
	},
	startdrag : function (thediv){
		PEditor.cudrager=thediv;
		PEditor.oy = thediv.style.top;
		PEditor.ox = thediv.style.left;
		eventh.handle(document,"mousemove",PEditor.follow);
		eventh.handle(document,"keypress",PEditor.order);
		eventh.handle(thediv,"mousedown",PEditor.stopdrag);
	},
	stopdrag : function (e){
		eventh.del(document,"mousemove",PEditor.follow);
		eventh.del(document,"keypress",PEditor.order);
		status="";
		try{
			eventh.del(PEditor.cudrager,"mousedown",PEditor.stopdrag);
			TimeShow.RPos(PEditor.cudrager);
			PEditor.cudrager=null;
		}catch(e){errors.record(e,"PEditor.stopdrag->end");}
	}
}